<style>

#map3 {
  height: 300px;
  border: 1px solid #000;
  
}
#map2 {
  height: 300px;
  border: 1px solid #000;
}

</style>

<?php 
if($mode== "new"){

	?>
<section class="wrapper">
	<!-- page start-->
	<section class="panel">
		<header class="panel-heading"> LISTING MANAGEMENT </header>
		
		<div>

		<div class="panel panel-default">
		<div class="panel-body">
		<div class="col-lg-12 col-lg-offset-0 clearfix">
			<form class="form-horizontal" role="form" method="POST" action="<?= base_url();?>secure/listing/listings/submit/new">
				
				
				<?php if($this->session->flashdata('message')) { 
				$show_message = $this->session->flashdata('message'); ?>
<span class="text text-danger"><?= $show_message; ?> </span>
<?php } ?>
				
				<hr class="separator" />
				
				<div class="row">
							<div class="form-group col-xs-6">
								<label>Lawyer/Lawfirm Name  </label>
								<span class="text text-danger"> <?php echo form_error('title'); ?></span>
								<input type="text" name="title" class="form-control"
									placeholder="Enter Lawyer or Lawfirm Name">
							</div>
						</div>
				<hr class="row">

						<div class="row">
							<div class="form-group col-xs-4">
								<label>Speciality/Expertization </label> ( CTRL+ for multiselect
								)
								<span class="text text-danger"> <?php echo form_error('speciality[]'); ?></span>
								<select multiple class="form-control" name="speciality[]" id="speciality">
									<?php foreach ($keyword as $speciality):?>
									<option value="<?=$speciality->id;?>">
										<?=$speciality->name;?>
									</option>
									<?php endforeach;?>
								</select>

							</div>
						</div>
<hr class="row">



						<div class="row">
							
							
							
							
							<div class="form-group col-lg-3">
								<div id="statediv" class="input-group" onClick="getlatttlong()">
									<label>State/Province</label>
									<span class="text text-danger"> <?php echo form_error('state'); ?></span>
									<select class="form-control" name="state" id="tutorstate">
										<option value="" selected="selected">- - - - - - - Select State - - - - - - -</option>
										<?php foreach ($state as $state):?>
										<option value="<?= $state->id;?>"><?= $state->statename;?></option>
										<?php endforeach;?>
									</select>
								</div>

							</div>
<div id="citydiv" class="form-group col-xs-3" onClick="getlatttlong()">
								<label>City/Area</label>
								<span class="text text-danger"> <?php echo form_error('city'); ?></span>
								<select class="form-control" name="city" id="tutorcity">
									<option value="" selected="selected">-Select-</option>
									
								</select>
							</div>
						</div>
						<!-- /.row -->


						<div class="row">
							
							<div class="form-group  col-xs-2">
								<label>Zip Code</label> 
								<span class="text text-danger"> <?php echo form_error('zip'); ?></span>
								<input type="text" class="form-control"
									name="zip" placeholder="Zip Code"
									>
							</div>
						</div>

						<hr class="row">

						<div class="row">
							<div class="form-group  col-xs-6" onClick="getlatttlong()">
								<label>Address Line 1</label>
								<span class="text text-danger"> <?php echo form_error('address1'); ?></span>
								<input type="text" class="form-control"
									placeholder="First Address" name="address1" id="street_address1"
									>
							</div>
						</div>

						<div class="row" onClick="getlatttlong()">
							<div class="form-group  col-xs-6">
								<label>Address Line 2</label> <input type="text"
									class="form-control" placeholder="Second Address"
									name="address2" id="street_address2"
									>
							</div>
						</div>
						
						<div class="row">
						<div class="form-group col-xs-6" style="display: none"  id="mymap2">
									<label>Select Place <span class="text text warning">(Drag the pointer)</span></label>
									<div class="controls">
										<div id="map2"></div>
									</div>
								</div>
								</div>	
									
									<div class="row hidden">
							<div class="form-group  col-xs-6">
								<label>Latitude </label> <input type="text" name="lat" id="lat"  class="form-control"
									placeholder="Latitude" >
							</div>
							<div class="form-group  col-xs-6">
								<label>Longitude</label> <input type="text" name="long" id="long" class="form-control"
									placeholder="Longitude">
							</div>
						</div>

						<div class="row">
							<div class="form-group  col-xs-3">
								<label>Phone No (1)</label>
								<span class="text text-danger"> <?php echo form_error('phone'); ?></span>
								<input type="text" class="form-control" name="phone"
									placeholder="Enter Phone 1"
								>
							</div>
							</div>
							<div class="row">
							<div class="form-group  col-xs-3">
								<label>Phone No (2)</label> <input type="text" class="form-control"
									placeholder="Enter Phone 2" name="phone2"
									>
							</div>
						</div>
						<div class="row">
						<div class="form-group  col-xs-3">
								<label>Fax</label> <input type="text" class="form-control"
									placeholder="Enter Fax" name="fax"
									>
							</div>
						</div>
						
						<hr class="row">

						<div class="row">
							<div class="form-group  col-xs-6">
								<label>Email ID</label>
								<span class="text text-danger"> <?php echo form_error('email'); ?></span>
								<input type="text" class="form-control"
									placeholder="Enter Email Id" name="email"
									>
							</div>
						</div>

						<div class="row">
							<div class="form-group  col-xs-6">
								<label>Website </label> <small>( Don't enter http:// eg.
									www.mysite.com )</small>
								
								<input type="text" class="form-control"
									placeholder="Enter Website Url" name="website"
									>
							</div>
						</div>


						<hr class="row">

						<div class="row">
							<p class="lead">Social Media</p>
							<div class="form-group  col-xs-6">
								<label>Facebook Link</label> <input type="text" name="facebook_link"
									class="form-control" placeholder="Enter Facebook Link">
							</div>
							</div>
						<div class="row">
							
							<div class="form-group  col-xs-6">
								<label>Twitter Link </label><input type="text" name="twitter_link"
									class="form-control" placeholder="Enter Twitter Link">
							</div>
						</div>

						<div class="row">
							<div class="form-group  col-xs-6">
								<label>Google Link</label> <input type="text" name="google_link"
								
									class="form-control" placeholder="Enter Google Link">
							</div>
							</div>
							<div class="row">
						
							<div class="form-group  col-xs-6">
								<label>Linkedin Link </label><input type="text" name="linkedin_link"
									class="form-control" placeholder="Enter LinkedIn Link">
							</div>
						</div>

						<hr class="row">

						<div class="row">
							<div class="form-group  col-xs-6">
								<label>Language Spoken </label>
								<span class="text text-danger"> <?php echo form_error('language'); ?></span>
								<input type="text" name="language"
									placeholder="Enter Language Spoken"
									class="form-control" placeholder="English, French, Dutch">

							</div>
						</div>
						<div class="row">
							<div class="form-group  col-xs-4">
							
								
								<label>Payment Methods </label>
							 <p class="checkbox">
									<input type="checkbox" name="payment[]" value="Cash">
									Cash
								</p>

								<p class="checkbox">
									<input type="checkbox" name="payment[]" value="Debit Card">
									Debit Card
								</p>
								<p class="checkbox">
									<input type="checkbox" name="payment[]" value="Credit Card">
									Credit Card
								</p>
								<p class="checkbox">
									<input type="checkbox" name="payment[]" value="Check (Bank)">
									Cheque (Bank)
								</p>
 								
							</div>

							<div class="form-group  col-xs-2">
								<label>Free Consultation</label>
								<p class="small">(in Minutes. eg. 20)</p>
								<input type="text" name="consultation" class="form-control " placeholder="Minutes">
							</div>
						</div>
						</div>
						
						
						<hr class="row">

						<div class="row">
							<div class="form-group  col-xs-12">
								<label>About you</label> <small>( Leangth 150 to 1000 words )</small>
								<span class="text text-danger"> <?php echo form_error('about'); ?></span>
								<textarea name="about" class="form-control" rows="5"></textarea>
							</div>
						</div>
						
						
<div class="col-xs-12">
						<button type="submit" class="btn btn-danger pull-right" <?php if($this->config->item('mode')=='DEMO'){?>onclick="alert ('Sorry! Not allowed in demo mode '); return false;" <?} else?>onclick="return confirm('Are you sure ?');">Submit
							Profile</button>
					</div>
					</form>
						
		</div>
		</div>
		</div>
		</div>
		<!-- End of Body Panel -->
	</section>
	<!-- page end-->
</section>
	
	
	
<?php }?>
<?php 
if($mode=="edit"){
	?>

	
	
<section class="wrapper">
	<!-- page start-->
	<section class="panel">
		<header class="panel-heading"> LISTING MANAGEMENT :  <span class="text text-warning">(<?= $listing['info']->title;?>)</span> </header>
		
		<div>

		<div class="panel panel-default">
		<div class="panel-body">
		<div class="col-lg-12 col-lg-offset-0 clearfix">
			<form class="form-horizontal" role="form" method="POST" action="<?= base_url();?>secure/listing/listings/submit/edit/<?= $listing['info']->id;?>">
				
				<?php if($this->session->flashdata('message')) { 
				$show_message = $this->session->flashdata('message'); ?>
<span class="text text-danger"><?= $show_message; ?> </span>
<?php } ?>
				<hr class="separator" />
				<div class="row">
							<div class="form-group col-xs-1">
								<label>Mem Id </label>
								<error> <?php echo form_error('title'); ?></error>
								<input type="text" name="mem_id" class="form-control"
									value="<?php echo $listing['info']->mem_id;?>"
								>
							</div>
						</div>
						
						<div class="row">
							<div class="form-group col-xs-2">
								<label>Featured</label>
								
								<select class="form-control" name="featured">
										<option value="" selected="selected">-Select-</option>
										<option value="0"
									<?php if ($listing['info']->featured=="0") echo 'selected="selected"';?>>Inactive</option>

									<option value="1"
									<?php if ($listing['info']->featured=="1") echo 'selected="selected"';?>>Active</option>
												</select>
							</div>
						</div>
						
				<div class="row">
							<div class="form-group col-xs-6">
								<label>Lawyer/Lawfirm Name </label>
								<error> <?php echo form_error('title'); ?></error>
								<input type="text" name="title" class="form-control"
									value="<?php echo $listing['info']->title;?>"
									placeholder="Enter Lawyer or Lawfirm Name">
							</div>
						</div>
				<hr class="row">

						<div class="row">
							<div class="form-group col-xs-4">
								<label>Speciality/Expertization </label> ( CTRL+ for multiselect
								)
								<error> <?php echo form_error('speciality'); ?></error>
								<select multiple class="form-control" name="speciality[]" multiple="multiple"">
									<?php foreach($speciality as $keywords):?>


										<?php $key= $this->admin_listing_model->get_listing_keyword($listing['info']->id,$keywords->id);?>

										<option value="<?= $keywords->id;?>"
										<?php if($key == $keywords->id){
											echo "selected=selected";
											}?>>


											<?= $keywords->name;?>

										</option>
										<?php endforeach;?>
								</select>

							</div>
						</div>
<hr class="row">



						<div class="row">
							
							<div class="form-group col-lg-3">
								<div id="statediv" class="input-group" onClick="getlattttlong()">
									<label>State/Province</label>
									<error> <?php echo form_error('state'); ?></error>
									<select class="form-control" name="state" id="tutorstate">
										<option value="" selected="selected">-Select-</option>
										<?php foreach($state as $state):?>
										<option value="<?= $state->id;?>"
									<?php if($state->id == $listing['info']->state){echo "selected=selected";}?>>
										<?= $state->statename;?></option>
									<?php endforeach;?>
									</select>
								</div>

							</div>
<div id="citydiv" class="form-group col-xs-3" onClick="getlattttlong()">
								<label>City/Area</label>
								<error> <?php echo form_error('city'); ?></error>
								<select class="form-control" name="city" id="tutorcity">
									<option value="" selected="selected">-Select-</option>
									<?php foreach($city['info'] as $city):?>
									<option value="<?= $city->id;?>"<?php if($city->id == $listing['info']->city){echo "selected=selected";}?>" >
										<?= $city->cityname;?></option>
								<?php endforeach;?>
								</select>
							</div>
						</div>
						<!-- /.row -->


						<div class="row">
							
							<div class="form-group  col-xs-2">
								<label>Zip Code</label> <input type="text" class="form-control"
									name="zip" placeholder="Zip Code"
									value="<?php echo $listing['info']->zip;?>">
							</div>
						</div>

						<hr class="row">

						<div class="row">
							<div class="form-group  col-xs-6" onClick="getlattttlong()">
								<label>Address Line 1</label>
								<error> <?php echo form_error('address1'); ?></error>
								<input type="text" class="form-control"
									placeholder="First Address" name="address1" id="street_address1"
									value="<?php echo $listing['info']->address1;?>">
							</div>
						</div>

						<div class="row" onClick="getlattttlong()">
							<div class="form-group  col-xs-6">
								<label>Address Line 2</label> <input type="text"
									class="form-control" placeholder="Second Address"
									name="address2" id="street_address2"
									value="<?php echo $listing['info']->address2;?>">
							</div>
						</div>
						
						<div class="row">
						<div class="form-group col-xs-6"  id="mymap3">
									<label>Select Place <span class="text text warning">(Drag the pointer)</span></label>
									<div class="controls">
										<div id="map3"></div>
									</div>
								</div>
								</div>	
									
									<div class="row hidden">
							<div class="form-group  col-xs-6">
								<label>Latitude </label> <input type="text" name="lat" id="lat" value="<?= $listing['info']->lat;?>" class="form-control"
									placeholder="Latitude" >
							</div>
							<div class="form-group  col-xs-6">
								<label>Longitude</label> <input type="text" name="long" id="long" value="<?= $listing['info']->long;?>" class="form-control"
									placeholder="Longitude">
							</div>
						</div>

						<div class="row">
							<div class="form-group  col-xs-3">
								<label>Phone No (1)</label>
								<error> <?php echo form_error('phone'); ?></error>
								<input type="text" class="form-control" name="phone"
									placeholder="Enter Phone"
									value="<?php echo $listing['info']->phone1;?>">
							</div>
							</div>
							<div class="row">
							<div class="form-group  col-xs-3">
								<label>Phone No (2)</label> <input type="text" class="form-control"
									placeholder="Enter Phone 2" name="phone2"
									value="<?php echo $listing['info']->phone2;?>">
							</div>
						</div>
						<div class="row">
						<div class="form-group  col-xs-3">
								<label>Fax</label> <input type="text" class="form-control"
									placeholder="Enter Fax" name="fax"
									value="<?php echo $listing['info']->fax;?>">
							</div>
						</div>
						
						<hr class="row">

						<div class="row">
							<div class="form-group  col-xs-6">
								<label>Email ID</label>
								<error> <?php echo form_error('email'); ?></error>
								<input type="text" class="form-control"
									placeholder="Enter email" name="email"
									value="<?php echo $listing['info']->email;?>">
							</div>
						</div>

						<div class="row">
							<div class="form-group  col-xs-6">
								<label>Website </label> <small>( Don't enter http:// eg.
									www.mysite.com )</small>
								<error> <?php echo form_error('website'); ?></error>
								<input type="text" class="form-control"
									placeholder="Enter Website" name="website"
									value="<?php echo $listing['info']->website;?>">
							</div>
						</div>


						<hr class="row">

						<div class="row">
							<p class="lead">Social Media</p>
							<div class="form-group  col-xs-6">
								<label>Facebook Link</label> <input type="text" name="facebook_link"
									value="<?php echo $listing['info']->facebook;?>"
									class="form-control" placeholder="Facebook">
							</div>
							</div>
						<div class="row">
							
							<div class="form-group  col-xs-6">
								<label>Twitter Link </label><input type="text" name="twitter_link"
									value="<?php echo $listing['info']->twitter;?>"
									class="form-control" placeholder="Twitter">
							</div>
						</div>

						<div class="row">
							<div class="form-group  col-xs-6">
								<label>Google Link</label> <input type="text" name="google_link"
									value="<?php echo $listing['info']->googleplus;?>"
									class="form-control" placeholder="Google">
							</div>
							</div>
							<div class="row">
						
							<div class="form-group  col-xs-6">
								<label>Linkedin Link </label><input type="text" name="linkedin_link"
									value="<?php echo $listing['info']->linkedin;?>"
									class="form-control" placeholder="LinkedIn">
							</div>
						</div>

						<hr class="row">

						<div class="row">
							<div class="form-group  col-xs-6">
								<label>Language Spoken </label>
								<input type="text" name="language"
									value="<?php echo $listing['info']->language;?>"
									class="form-control" placeholder="English, French, Dutch">

							</div>
						</div>
						
						<div class="row">
							<div class="form-group  col-xs-8">
								<label>Payment Methods </label>
								<!-- 
								
								<ul class="list-unstyled">
								</ul>
								 -->
								<?php if($payment){?>
								<ul class="list-unstyled">
								 <?php foreach($payment as $payment):?>
									<li class="col-xs-5"> <input type="checkbox" name="payment[]" value="<?= $payment->term_value;?>" checked> <?= $payment->term_value;?></li>
								 <?php endforeach;?>
								</ul> 
								<?php }else{?>
								<ul class="list-unstyled">
									<li class="col-xs-6"> <input type="checkbox" name="payment[]" value="Cash"> Cash</li>
									<li class="col-xs-6"> <input type="checkbox" name="payment[]" value="Credit Card"> Credit Card</li>
									<li class="col-xs-6"> <input type="checkbox" name="payment[]" value="Debit Card"> Debit Card</li>
									<li class="col-xs-6"> <input type="checkbox" name="payment[]" value="Cheque (Bank)"> Cheque (Bank)</li>
								</ul>
								<?php }?>
							</div>
							<div class="form-group  col-xs-2">
								<label>Free Consultation</label>
								<p class="small">(in Minutes. eg. 20)</p>
								<input type="text" class="form-control " name="consultation" value="<?= $listing['info']->consultation;?>" placeholder="Minutes">
							</div>
						</div>
						<hr class="row">

						<div class="row">
							<div class="form-group  col-xs-12">
								<label>About you</label> <small>( Leangth 150 to 1000 words )</small>
								<textarea name="about" class="form-control" rows="5"><?= $listing['info']->description;?></textarea>
							</div>
						</div>
						
						<div class="row">
							<div class="form-group  col-xs-2">
								<label>VERIFIED</label>
								<input class="form-control" type="checkbox" name="verified" value="1" <?php if ($listing['info']->verified=="1") echo 'checked="checked"'?>" >
							</div>
						</div>

<div class="col-xs-12">
<input type="hidden" name="listing_id" value="<?= $listing['info']->id;?>">

						<button type="submit" class="btn btn-danger pull-right" <?php if($this->config->item('mode')=='DEMO'){?>onclick="alert ('Sorry! Not allowed in demo mode '); return false;" <?} else?>onclick="return confirm('Are you sure ?');">Submit
							Profile</button>
					</div>
					</form>
						
		</div>
		</div>
		</div>
		</div>
		<!-- End of Body Panel -->
	</section>
	<!-- page end-->
</section>

<hr class="separator" />

<?php }?>





